﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _09_Console
{
    public class Person
    {
        // 字段：人的私有信息
        // 属性：人对外暴露的信息

        // 构造方法
        public Person()
        {

        }
        // 有参的构造函数
        /// <summary>
        /// 人类
        /// </summary>
        /// <param name="nickName">姓名</param>
        /// <param name="card">身份证号</param>
        /// <param name="_birthday">生日</param>
        /// <param name="_sex">性别</param>
        public Person(string name,string idCard,DateTime birthday, string sex)
        {
            this.name = name;
            this.birthday = birthday;
            this.sex = sex;
            this.idCard = idCard;
        }
        public Person(string nickName)
        {
            name=nickName;
        }
        #region 字段
        private string name;
        private string idCard;
        private DateTime birthday;
        private string sex;
        #endregion

        #region 属性
        public string Name
        {
            get { return name; }
            set { name = value; }
        }
        public string IdCard
        {
            get { return idCard; }
            set { idCard = value; }
        }
        public DateTime Birthday
        {
            get { return birthday; }
            set { birthday = value; }
        }
        public string Sex
        {
            get { return sex; }
            set { sex = value; }
        }
        #endregion

        #region 成员方法
        public void Eat()
        {
            Console.WriteLine($"{name}要吃饭了");
        }
        public void Print()
        {
            Console.WriteLine($"Name:{name}\nBirthday:{birthday}\nIdCard:{idCard}\nSex:{sex}");
        }
        #endregion


    }
}
